﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x02000428 RID: 1064
	[DisallowMultipleComponent]
	public class ObservableCancelTrigger : ObservableTriggerBase, IEventSystemHandler, ICancelHandler
	{
		// Token: 0x06001634 RID: 5684 RVA: 0x0006124C File Offset: 0x0005F64C
		void ICancelHandler.OnCancel(BaseEventData eventData)
		{
			if (this.onCancel != null)
			{
				this.onCancel.OnNext(eventData);
			}
		}

		// Token: 0x06001635 RID: 5685 RVA: 0x00061268 File Offset: 0x0005F668
		public IObservable<BaseEventData> OnCancelAsObservable()
		{
			Subject<BaseEventData> result;
			if ((result = this.onCancel) == null)
			{
				result = (this.onCancel = new Subject<BaseEventData>());
			}
			return result;
		}

		// Token: 0x06001636 RID: 5686 RVA: 0x00061290 File Offset: 0x0005F690
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onCancel != null)
			{
				this.onCancel.OnCompleted();
			}
		}

		// Token: 0x04000C89 RID: 3209
		private Subject<BaseEventData> onCancel;
	}
}
